# 读取tmp.txt文件
# with open("tmp.txt", "r") as file:
with open("cka_tmp.txt", "r") as file:
    data = file.readlines()

# 将数据分割成数据段
data_segments = [data[i:i+6] for i in range(0, len(data), 6)]

# 将每个数据段的第一行写入不同的输出文件
for i, segment in enumerate(data_segments):
    if len(segment) > 1:  # 确保数据段不为空
        with open(f"tools/CKA_FILES/1.txt", "a") as file:
            file.write(segment[0])
        with open(f"tools/CKA_FILES/2.txt", "a") as file:
            file.write(segment[1])
        with open(f"tools/CKA_FILES/3.txt", "a") as file:
            file.write(segment[2])
        # with open(f"tools/CKA_FILES/4.txt", "a") as file:
        #     file.write(segment[3])
        # with open(f"tools/CKA_FILES/5.txt", "a") as file:
        #     file.write(segment[4])